<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('接洽成功列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>预约编号：</label>
                                <input type="text" name="reNumber"/>
                            </li>
                            <li>
                                <label>企业名称：</label>
                                <input type="text" name="companyName"/>
                            </li>
                            <li>
                                <label>预约日期：</label>
                                <input type="text" class="time-input" placeholder="请选择预约日期" name="reDate"/>
                            </li>
                            <li>
                                <label>接洽日期：</label>
                                <input type="text" class="time-input" placeholder="请选择接洽日期" name="acceptDate"/>
                            </li>
                            <li>
                                <label>账户性质：</label>
                                <select name="accountType" th:with="type=${@dict.getType('account_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>账号：</label>
                                <input type="text" name="accountNo"/>
                            </li>
                            <li>
                                <label>账户状态：</label>
                                <select name="accountState" th:with="type=${@dict.getType('account_state')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>联系人电话：</label>
                                <input type="text" name="contactsTel"/>
                            </li>
                            <li>
                                <label>联系人姓名：</label>
                                <input type="text" name="contactsName"/>
                            </li>
                            <li>
                                <label>预约银行：</label>
                                <input type="text" name="orgName"/>
                            </li>
                            <li>
                                <label>审核状态：</label>
                                <select name="accountCheck" th:with="type=${@dict.getType('account_check')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>


            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:info:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:info:remove')}]];
        var accountTypeDatas = [[${@dict.getType('account_type')}]];
        var accountStateDatas = [[${@dict.getType('account_state')}]];
        var accountCheckDatas = [[${@dict.getType('account_check')}]];
        var prefix = ctx + "system/info";

        $(function() {
            var options = {
                url: prefix + "/acceptOkList",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "预约开户记录",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'reNumber',
                    title: '预约编号'
                },
                {
                    field: 'companyName',
                    title: '企业名称'
                },
                {
                    field: 'address',
                    title: '企业地址'
                },
                {
                    field: 'reDate',
                    title: '预约日期'
                },
                {
                    field: 'acceptDate',
                    title: '接洽约定日期'
                },
                {
                    field: 'accountType',
                    title: '账户性质',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(accountTypeDatas, value);
                    }
                },

                {
                    field: 'accountState',
                    title: '账户状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(accountStateDatas, value);
                    }
                },
                {
                    field: 'contactsTel',
                    title: '联系人电话'
                },
                {
                    field: 'contactsName',
                    title: '联系人姓名'
                },
                    {
                        field: 'orgName',
                        title: '预约银行'
                    },

                {
                    field: 'updateBy',
                    title: '接洽人'
                },
                {
                    field: 'updateTime',
                    title: '接洽时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="acceptOk(\'' + row.id + '\')"><i class="fa fa-edit"></i>开户确认</a> ');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });

        /* 开户确认 */
        function acceptOk(id) {


            var url = prefix + '/acceptOkEdit/' + id;
            $.modal.openTab("开户预约接洽", url);
        }
    </script>
</body>
</html>